package com.tele.service.imps;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tele.domain.Cpu;
import com.tele.mapper.CpuMapper;
import com.tele.service.ints.CpuService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CpuServiceImp extends ServiceImpl<CpuMapper,Cpu> implements CpuService{


    @Override
    public int updateCpu(Cpu cpu) {
        return baseMapper.updateById(cpu);
    }

    @Override
    public int insertCpu(Cpu cpu) {
        return baseMapper.insert(cpu);
    }

    @Override
    public List<Cpu> getAllCpu() {


        return baseMapper.selectList(null);
    }

    @Override
    public int delCpu(Cpu cpu) {
        return baseMapper.deleteById(cpu);
//        return 0;
    }

//    @Override
//    public IPage<Cpu> selectPage(Page<Cpu> cpuPage, CpuVo cpuVo) {
//        if (cpuVo.id != null){
//            baseMapper.selectPage(cpuPage,new LambdaQueryWrapper<Cpu>().eq())
//        }
//        return null;
//    }

}
